//package com.grz.springbootdemo.config;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.multipart.MultipartResolver;
//
//@Configuration
//public class UploadConfig {
//
//    @Autowired
//    private UploadProperty uploadProperty;
//
//    @Bean
//    public MultipartResolver multipartResolver() {
//        CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
//        multipartResolver.setDefaultEncoding("UTF-8");
//        // 设置上传文件的大小，设置为5M
//        multipartResolver.setMaxUploadSizePerFile(uploadProperty.getMax());
//        return multipartResolver;
//    }
//}
